/**
 * 
 */
package com.worksmap.core.task;

import java.util.LinkedList;
import java.util.Queue;

/**
 * @author shhc
 *
 */
public class ProducerConsumerTest {
	 public static void main(String[] args) {  
//        PublicResource resource = new PublicResource();  
//        new Thread(new ProducerThread(resource)).start();  
//        new Thread(new ConsumerThread(resource)).start();  
//        new Thread(new ProducerThread(resource)).start();  
//        new Thread(new ConsumerThread(resource)).start();  
//        new Thread(new ProducerThread(resource)).start();  
//        new Thread(new ConsumerThread(resource)).start();  
        
        Queue<String> queue = new LinkedList<String>();  
        queue.offer("Hello");  
        queue.offer("World!");  
        queue.offer("你好！");  
        System.out.println(queue.size());  
        String str;  
        while((str=queue.poll())!=null){  
            System.out.print(str);  
        }  
        System.out.println();  
        System.out.println(queue.size());  
        
    }  
}
